{extend name="public/base" /} {block name="body"}
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li><strong>商品管理</strong></li>
	</ol>
</div>
<div class="ibox float-e-margins">
	<div class="ibox-content">
		
		<div class="hr-line-dashed" style="margin: 3px;"></div>
		<a href="{:url('add')}" class="btn btn-xs btn-primary">添加商品</a>
		<a href="{:url('padd')}" class="btn btn-xs btn-primary">导入</a>
		<a href="{:url('dc',['data'=>'1'])}" class="btn btn-xs btn-primary">导出</a>
		<div class="example-wrap">
			<div class="example">				
					<table class="table table-bordered table-hover">
						<thead>
							<tr class="long-th">
								<th>商品名称</th>
								<th>商品分类</th>
								<th>商品单位</th>
								<th>销售价(元)</th>
								<th>添加时间</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							{foreach name="list" item="ad"}
							<tr>	
								<td class="text-center">{$ad.goods_name}</td>
								<td class="text-center">{$ad.name}</td>
								<td class="text-center">{$ad.unit}</td>
								<td class="text-center">{$ad.sale_price}</td>
								<td class="text-center">{$ad.add_time}</td>
								<td class="text-center">
									<a href="{:url('edit',['id'=>$ad.id])}" class="btn btn-primary bnt-sm">
										<i class="fa fa-paste"></i> 编辑</a>&nbsp;&nbsp;
									{if condition="$ad.goods_state == 2"}
									<a href="{:url('offshelf',['id'=>$ad.id,'goods_state'=>$ad.goods_state])}" class="btn btn-danger bnt-sm ajax-do">
										<i class="fa fa-cart-arrow-down"></i> 下架</a>&nbsp;&nbsp; 
									{else}
									<a href="{:url('offshelf',['id'=>$ad.id,'goods_state'=>$ad.goods_state])}" class="btn btn-primary bnt-sm ajax-do">
										<i class="fa fa-cart-plus"></i> 上架</a>&nbsp;&nbsp; 
									{/if}
									<a href="{:url('delete',['id'=>$ad.id])}" class="btn btn-danger bnt-sm ajax-delete">
										<i class="fa fa-trash-o"></i> 删除</a>
								</td>
							</tr>
							{/foreach}
						</tbody>
					</table>
					<div style="text-align: right;">
                      {$list->render()}
                   </div>				
			</div>
		</div>
	</div>
</div>
{/block} {block name="script"}
<script>
</script>
<style>
.bank{
	width: 150px;
    height:30px;
    text-align:center;
    border-radius:5px;
}
</style>
{/block}